<style>
	#container{
		padding: 0px;
		border-radius:0px;
		border-width:0px;
	}
</style>
<form class="layui-form seller-alone-form" method="post">
	<div class="layui-form-item">
		<label class="layui-form-label"><i class="required-color">*</i>导航：</label>
		<div class="layui-input-block">
			<select name="nav_id" lay-verify="required" lay-search>
				<option value="">请选择导航</option>
				{volist name='navLists' id='vo'}
				<option value="{$vo.id}">{$vo.title}</option>
				{/volist}
			</select>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label"><i class="required-color">*</i>标题：</label>
		<div class="layui-input-block">
			<input type="text" name="title" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label"><i class="required-color">*</i>在首页置顶：</label>
		<div class="layui-input-block">
			<input type="radio" name="is_top" value="1" title="是">
			<input type="radio" name="is_top" value="2" checked title="否">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label"><i class="required-color">*</i>在首页显示：</label>
		<div class="layui-input-block">
			<input type="radio" name="is_index" value="1" title="是">
			<input type="radio" name="is_index" value="2" checked title="否">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label"><i class="required-color">*</i>图片：</label>
		<div class="layui-input-inline seller-inline-5">
			{Jshop:image id='pic' name='pic'/}
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label"><i class="required-color">*</i>来源：</label>
		<div class="layui-input-block">
			<select name="source" lay-verify="required" lay-search>
				<option value="">请选择来源</option>
				<option value="1">湖南职校网</option>
				<option value="2">网络转载</option>
			</select>
		</div>
	</div>
	<div class="layui-form-item" style="margin-bottom: 10px;">
		<label class="layui-form-label"><i class="required-color">*</i>简介：</label>
		<div class="layui-input-block">
			<textarea name="brief" placeholder="请输入简介" class="layui-textarea"></textarea>
		</div>
	</div>
	<div class="layui-form-item layui-form-text" style="margin: 10px 0 10px 0;">
		<label class="layui-form-label"><i class="required-color">*</i>内容：</label>
		<div class="layui-input-block" style="z-index: 1">
			<textarea id="container" name="content" style="width:100%;height:300px;" type="text/plain" class="layui-textarea"></textarea>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-input-block">
			{:jshopToken('resource_add')}
			<button type="button" class="layui-btn" lay-submit lay-filter="add_resource">保存</button>
			<button onclick="javascript:history.back(-1);" type="reset" class="layui-btn layui-btn-primary">返回</button>
		</div>
	</div>
</form>
<script>
	layui.use('form', function () {
		var form = layui.form;
		//监听提交
		form.on('submit(add_resource)', function (data) {
			JsPost("{:url('resource/add')}", data.field, function (res) {
				if (res.status) {
					layer.msg(res.msg, {time: 1300}, function () {
						window.location.href = "{:url('resource/lists')}";
					});
				} else {
					layer.msg(res.msg);
				}
			})
		});
	});
</script>
<script type="text/javascript">
	var ue = UE.getEditor('container');
</script>